<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sinox="http://www.sinosoft.com.cn/sinox"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:param name="compBean1Id" value="fieldsTable" />
	
	<p:toolbar height="22px" styleClass="sino-toolbar-on-datatable">
		<p:toolbarGroup align="left">
	    	<div style="float:left;">
	    		<p:spacer width="10" height="25" />
	    	</div>
	    	<div style="float:left;margin-top:5px;">
	    		<h:outputText value="参数字段列表"/>
	    	</div>
	    </p:toolbarGroup>
	    
	    <p:toolbarGroup align="right">
	    	<p:commandButton title="添加" value="添加"
				actionListener="#{bpmAction.addDefineFieldAction}"
				update="#{compBean1Id}">
				<h:inputHidden value="#{commonContentViewBean.id}" />
			</p:commandButton>
			
			<p:commandButton title="删除" value="删除"
				actionListener="#{bpmAction.removeDefineFieldAction}"
				update="#{compBean1Id}">
				<h:inputHidden value="#{commonContentViewBean.id}" />
			</p:commandButton>
	    </p:toolbarGroup>
	</p:toolbar>
	
	<p:dataTable id="#{compBean1Id}" var="af" value="#{commonContentViewBean.defineFields}"
        emptyMessage="请添加参数字段" selectionMode="multiple" rowIndexVar="afvar"
        selection="#{commonContentViewBean.selectedRows}">
  		
  		<p:column headerText="序号" style="width:20px;">
  			<p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{afvar + 1}"/>
                </f:facet>  
                <f:facet name="input">
					<h:outputText value="#{afvar + 1}"/>
                </f:facet>
            </p:cellEditor>
		</p:column>
		
		<p:column headerText="参数名" style="width:100px;">
			<p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{af.ver}" />
                </f:facet>  
                <f:facet name="input">
                	<h:inputText value="#{af.ver}" style="width:100%"/>
                </f:facet>
            </p:cellEditor>
		</p:column>
		
		<p:column headerText="表达式语言" style="width:50px;">
			<p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{bpmSelectItemsService.itemsMap.lang[af.lang]}" />
                </f:facet>  
                <f:facet name="input">  
                    <sinox:selectOneMenu value="#{af.lang}"
						items="#{bpmSelectItemsService.items.lang}" width="150" />
                </f:facet>
            </p:cellEditor>
		</p:column>
		
		<p:column headerText="表达式">
			<p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{af.expr}" />  
                </f:facet>  
                <f:facet name="input">  
                    <h:inputText value="#{af.expr}" style="width:100%"/>  
                </f:facet>
            </p:cellEditor>
		</p:column>
  		
  		<p:column headerText="编辑" style="width:20px;">  
            <p:rowEditor />  
        </p:column>
    </p:dataTable>
</ui:composition>